package com.jy.controller;


import com.jy.common.enums.ResponseWrapper;
import com.jy.common.tool.CommonTool;
import com.jy.service.GoodsIndexSwiperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
 * <p>
 * 商品首页轮播图表 前端控制器
 * </p>
 *
 * @author fzg
 * @since 2024-11-14
 */
@RestController
@RequestMapping("/goods-index-swiper")
public class GoodsIndexSwiperController {

    private final GoodsIndexSwiperService goodsIndexSwiperService;

    public GoodsIndexSwiperController(GoodsIndexSwiperService goodsIndexSwiperService) {
        this.goodsIndexSwiperService = goodsIndexSwiperService;
    }


    /**
     * 获取轮播图和购物车商品数量
     * @param request request
     * @return ResponseWrapper
     */
    @GetMapping("/getGoodsIndexPageSwiperApi")
    public ResponseWrapper getGoodsIndexPageSwiperApi(HttpServletRequest request) {
        return goodsIndexSwiperService.getGoodsIndexPageSwiperApi(CommonTool.getUserAidByToken(request));
    }


}
